<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>

<body>

    <ul>
        <!-- <li>1111</li>
        <li>1111</li>
        <li>1111</li> -->
    </ul>




    <script>

        // 新闻列表
        var data = [
            '今天天气不错',
            '今天天气不错1',
            '今天天气不错2'
        ];


        // 渲染页面

        // 根据数据循环生成多个li   ---  可以把这些li标签当做字符串来看
        var res = '';
        for (var i = 0; i < data.length; i++) {
            // res += '<li>' + data[i] + '</li>'
            res += `<li>${data[i]}</li>`;


        }

        console.log(res);

        var oUl = document.querySelector('ul');

        oUl.innerHTML = res;




    </script>

</body>

</html>